home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / G / Graph.CL.cpt / CL to Graph Converter / card_2982.txt < prev    next >
Encoding:
Text File  |  1988-10-30  |  5.6 KB  |  185 lines

  1. -- card: 2982 from stack: in
  2. -- bmap block id: 3319
  3. -- flags: 0000
  4. -- background id: 2727
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=181 top=261 right=300 bottom=335
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Start Conversion
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   --remember to OPEN & CLOSE the TEXT files
  23.   ask "Which file do you wish to Convert??" with "CL.ANALYSIS"
  24.   if it is empty then exit mouseUp
  25.   put it into importName
  26.   open file importName
  27.   ask "What do you wish to name export file??" with "Chart Data"
  28.   if it is empty then exit mouseUp
  29.   put it into exportName
  30.   open file exportName
  31.   put the secs into start
  32.   set lockScreen to true
  33.   set cursor to 4
  34.   write "Monthy Report" & return & tab & "Hours" & tab & "Logins" & return to file exportName
  35.   repeat forever
  36.     read from file importName until return
  37.     put it into tempLine --temp field
  38.  
  39.     if the length of tempLine <=1 then --we have no record to process
  40.       exit repeat
  41.     end if
  42.  
  43.     put char 1 to 2 of tempLine into itemOne --month label
  44.     put char 8 to 10 of tempLine into itemTwo --hours per month
  45.     put char 22 to 25 of tempLine into itemThree --logins per month
  46.  
  47.     if first char of itemOne = " " then
  48.       delete first char of itemOne
  49.     end if
  50.     repeat until first char of itemTwo <> " "
  51.       delete first char of itemTwo
  52.     end repeat
  53.     repeat until first char of itemThree <> " "
  54.       delete first char of itemThree
  55.     end repeat
  56.     write itemOne & tab & itemTwo & tab & itemThree & return to file exportName
  57.   end repeat
  58.  
  59.   write return & return & "Weekly Report" & return to file exportName
  60.   write tab & "Hours" & tab & "Logins" & return to file exportName
  61.   put 1 into count
  62.   repeat forever
  63.     read from file importName until return
  64.     put it into tempLine --temp field
  65.  
  66.     if the length of tempLine <=1 then --we have no record to process
  67.       exit repeat
  68.     end if
  69.  
  70.     put count into itemOne --week label
  71.     put char 9 to 13 of tempLine into itemTwo --hours per week
  72.     put char 23 to 28 of tempLine into itemThree --logins per week
  73.  
  74.     repeat until first char of itemTwo <> " "
  75.       delete first char of itemTwo
  76.     end repeat
  77.     repeat until first char of itemThree <> " "
  78.       delete first char of itemThree
  79.     end repeat
  80.     write itemOne & tab & itemTwo & tab & itemThree & return to file exportName
  81.     add 1 to count
  82.   end repeat
  83.  
  84.  
  85.   write return & return & "Daily Report" & return to file exportName
  86.   write tab & "Min." & tab & "LogX10" & return to file exportName
  87.   put 1 into count
  88.   repeat forever
  89.     read from file importName until return
  90.     put it into tempLine --temp field
  91.  
  92.     if the length of tempLine <=1 then --we have no record to process
  93.       exit repeat
  94.     end if
  95.  
  96.     put count into itemDay --day label
  97.     put char 12 to 13 of tempLine into itemOne --hours per day
  98.     put char 15 to 16 of tempLine into itemTwo --minutes per day
  99.     put char 23 to 28 of tempLine into itemThree --logins per day
  100.  
  101.     repeat until first char of itemOne <> " "
  102.       delete first char of itemOne
  103.     end repeat
  104.     repeat until first char of itemTwo <> "0"
  105.       delete first char of itemTwo
  106.     end repeat
  107.     multiply itemOne by 60
  108.     add itemOne to itemTwo
  109.     repeat until first char of itemThree <> " "
  110.       delete first char of itemThree
  111.     end repeat
  112.     multiply itemThree by 10
  113.     write itemDay & tab & itemTwo & tab & itemThree & return to file exportName
  114.     add 1 to count
  115.   end repeat
  116.  
  117.  
  118.   write return & return & "Hour / Day Report" & return to file exportName
  119.   write tab & "Hours" & tab & "Logins" & return to file exportName
  120.   repeat forever
  121.     read from file importName until return
  122.     put it into tempLine --temp field
  123.  
  124.     if the length of tempLine <=1 then --we have no record to process
  125.       exit repeat
  126.     end if
  127.  
  128.     put char 1 to 3 of tempLine into itemOne --day
  129.     put char 7 to 9 of tempLine into itemTwo --hours per day
  130.     put char 21 to 24 of tempLine into itemThree --logins per day
  131.  
  132.     repeat until first char of itemTwo <> " "
  133.       delete first char of itemTwo
  134.     end repeat
  135.     repeat until first char of itemThree <> " "
  136.       delete first char of itemThree
  137.     end repeat
  138.     write itemOne & tab & itemTwo & tab & itemThree & return to file exportName
  139.   end repeat
  140.  
  141.  
  142.   write return & return & "Hourly Report" & return to file exportName
  143.   write tab & "Min." & tab & "LogX10" & return to file exportName
  144.   put 1 into count
  145.   repeat forever
  146.     read from file importName until return
  147.     put it into tempLine --temp field
  148.  
  149.     if the length of tempLine <=1 then --we have no record to process
  150.       exit repeat
  151.     end if
  152.  
  153.     put count into itemDay --Hour label
  154.     put char 16 to 17 of tempLine into itemOne --hours per hour range
  155.     put char 19 to 20 of tempLine into itemTwo --minutes per hour range
  156.     put char 30 to 32 of tempLine into itemThree --logins per hour range
  157.  
  158.     repeat until first char of itemOne <> " "
  159.       delete first char of itemOne
  160.     end repeat
  161.     repeat until first char of itemTwo <> "0"
  162.       delete first char of itemTwo
  163.     end repeat
  164.     multiply itemOne by 60
  165.     add itemOne to itemTwo
  166.     repeat until first char of itemThree <> " "
  167.       delete first char of itemThree
  168.     end repeat
  169.     multiply itemThree by 10
  170.     write itemDay & tab & itemTwo & tab & itemThree & return to file exportName
  171.     add 1 to count
  172.   end repeat
  173.  
  174.   close file importName
  175.   close file exportName
  176. end mouseUp
  177.  
  178. if the length of tempLine <=1 then --we have no record to process
  179.   close file importName
  180.   close file exportName
  181.   exit repeat
  182. end if
  183.  
  184.  
  185.